#ifndef RELATIONLABEL_H
#define RELATIONLABEL_H

#include <QGraphicsPathItem>
#include <QGraphicsSimpleTextItem>
#include <limits>

#include "uml/umlgraphicsitem.h"
#include "uml/pen/relationpen.h"

class RelationLabel : public UmlGraphicsItem
{
    Q_OBJECT
public:
    RelationLabel();

    virtual QString text();
    virtual void setText(QString name);

    void setBrush(QBrush brush);

    void updateBoundingbox();

    void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);

    QRectF boundingRect() const;

    QVariant itemChange(GraphicsItemChange change, const QVariant &value);

protected:
    RelationPen _pen;

    QRectF _boundingRect;

    QGraphicsPathItem _borderItem;
    QGraphicsSimpleTextItem _textItem;

signals:
    void labelDoubleClick(QGraphicsSceneMouseEvent *event);
};

#endif // RELATIONLABEL_H
